<html>
    <head>
        <title>Login to BuzzPulse Mobile site</title>
        <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <link type="text/css" rel="stylesheet" href="CSS/Mobile/login.css"/>
        <script type="text/javascript" src="JS/Mobile/soapclient.js"></script>
        <script type="text/javascript" src="JS/Mobile/md5.js"></script>
        <script type="text/javascript">
            function getlogin() {
                var pl = new SOAPClientParameters();
                pl.add("typedata", "login");
                pl.add("email", document.login.username.value.trim());
                pl.add("password", hex_md5(document.login.password.value.trim()));
                SOAPClient.invoke("/m/", "getLogin", pl, true, login);
            }

            function login(r) {
                if (r == null) {
                    document.getElementById('error').innerHTML = 'Email and password does not match. Please try again';
                }
                if (r["email"] != "") {
                    if (document.login.password.value === 'buzzpulse') {
                        window.location = '/#settings/account';
                        window.location.reload(true);
                    }
                    else
                        window.location.reload(true);
                }
            }
        </script>
    </head>
    <body>
        <div class="wrapper">
            <div class="buzzpulse-header-bar centered">
                <div class="header content clearfix"><img alt="buzzpulse" class="logo"
                src="Images/logo_beta.png"></div>
            </div>
            <div class="main content clearfix">
                <div class="card signin-card">
                    <p class="profile-name"></p>
                    <form name="login" action="" method="POST" onsubmit="getlogin(); return false;">
                        <label class="hidden-label">Email</label>
                        <input id="id_username" name="username" placeholder="Your Username or Email" type="text">
                        <label class="hidden-label">Password</label>
                        <input id="id_password" name="password" placeholder="Your Password" type="password">
                        <div id="error" style="color: #dd4b39; margin-bottom: 5px;">&nbsp;</div>
                        <input class="rc-button rc-button-submit" type="submit" value="Log me in">
                        <a class="forgot-password-link" style="margin-top: 10px; font-size: 14px;" href="/front/account/forgot_password/">I forgot my password</a>
                    </form>
                </div>
            </div>
        </div>
    </body>
</html>

